<%
layout("/include/_dialog.html"){
%>
	<script type="text/javascript">

	function save() {
		var isValidate = jp.validateForm('#inputForm');//校验表单
		if(!isValidate){
			return false;
		}else{
			jp.loading();
			jp.post("${ctx}/sys/dataRule/save",$('#inputForm').serialize(),function(data){
				if(data.success){
					jp.getParent().refresh();
					var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
					parent.layer.close(dialogIndex);
					jp.success(data.msg)
				}else{
					jp.error(data.msg);
				}
			})
		}

	}
		
	</script>


<form id="inputForm"  method="post" class="p-15 form-horizontal">
		<input type="hidden" name="id" value="${dataRule.id}">
		<input type="hidden" name="menuId" value="${dataRule.menuId}">
			<div class="form-group row">
				<label class="col-sm-2 control-label">数据规则名称：</label>
				<div class="col-sm-8">
					<input name="name" value="${dataRule.name}" class="form-control "/>
				</div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">规则实体类：</label>
				<div class="col-sm-8">
					<input name="className" value="${dataRule.className}"    class="form-control "/>
						<span class="font-13 text-muted">请输入要进行数据过滤的的实体类名(不含包名,例如：User),将对findList和findAllList进行数据过滤。</span>
				</div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">规则字段：</label>
				<div class="col-sm-8">
					<input name="field" value="${dataRule.field}"    class="form-control "/>
				</div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">规则条件：</label>
				<div class="col-sm-8">
					<#select path="express" value="${dataRule.express}" items="${fn.getDictList('t_express')}" itemLabel="label" itemValue="value" class="form-control "/>
				</div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">规则值：</label>
				<div class="col-sm-8">
					<input name="value" value="${dataRule.value}"    class="form-control "/>
				</div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">自定义sql：</label>
				<div class="col-sm-8">
					<textarea name="sqlSegment" rows="4"    class="form-control ">${dataRule.sqlSegment}</textarea>
				</div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">备注信息：</label>
				<div class="col-sm-8">
					<textarea name="remarks" rows="4"    class="form-control ">${dataRule.remarks}</textarea>
				</div>
			</div>
	</form>
<% } %>